package com.aoip.telemetry.telemetry.configureui.business.order.send.service.impl;

import com.aoip.telemetry.telemetry.configureui.business.analysis.access.mapper.StOnlineStatusMapper;
import com.aoip.telemetry.telemetry.configureui.business.order.cases.service.OrderCaseService;
import com.aoip.telemetry.telemetry.configureui.business.order.send.service.OrderSendService;
import com.aoip.telemetry.telemetry.core.call.GenerateOrder;
import com.aoip.telemetry.telemetry.entity.equipment.QuerySetOrderEntity;
import com.aoip.telemetry.telemetry.entity.equipment.StOnlineStatusEntity;
import com.aoip.telemetry.telemetry.entity.order.OrderBaseEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chenbai
 * @version 1.0
 * @date 2022/2/23 14:32
 */
@Service
public class OrderSendServiceImpl implements OrderSendService {

    @Resource
    private StOnlineStatusMapper statusMapper;

    @Resource
    private OrderCaseService service;

    @Resource
    private GenerateOrder generateOrder;


    @Override
    public List<StOnlineStatusEntity> list(StOnlineStatusEntity entity) {
        return statusMapper.list(entity);
    }

    @Override
    public QuerySetOrderEntity generateOrder(List<String> msgList, String orderId, String stCode) {
        OrderBaseEntity order = service.order(orderId);
        return generateOrder.generate(msgList,stCode,order);
    }

}
